#ifndef _NE_NUMERIC_ANIMATION_TRACK_H_
#define _NE_NUMERIC_ANIMATION_TRACK_H_

#include <animation/AnimationTrack.h>
#include <animation/NumericKeyFrame.h>

namespace ne
{
    class NEAPI NumericAnimationTrack : public AnimationTrack
    {
        public:
            NumericAnimationTrack(Animation *parent, const uint16_t handle);

            NumericAnimationTrack(Animation *parent, const uint16_t handle, real *number);

            virtual NumericKeyFrame* createNumericKeyFrame(const real time);

            virtual void setAssociatedNumeric(real *number);

            virtual real* getAssociatedNumeric() const;

            virtual NumericKeyFrame* getNumericKeyFrame(const size_t index) const;

            virtual void getKeyFrameAtTime(const real time, KeyFrame &keyFrame) const;

            virtual void getNumericKeyFrameAtTime(const real time, NumericKeyFrame &keyFrame) const;

            virtual void apply(const real time, const real weight=1.0f, const real scaleU=1.0f);

            virtual void applyToNumeric(real *number, const real time, const real weight=1.0f, const real scaleU=1.0f);

            virtual bool hasNonZeroKeyFrames() const;

            virtual void optimise();

            virtual void _keyFrameDataChanged() const;

            virtual ~NumericAnimationTrack();

        protected:
            virtual KeyFrame* _createKeyFrameImpl(const real time);

        private:
            NumericAnimationTrack();

            NumericAnimationTrack(const NumericAnimationTrack &);

            NumericAnimationTrack& operator = (const NumericAnimationTrack &);

        protected:
            real *mpTargetNumeric;
    };

    typedef std::map<uint16_t, NumericAnimationTrack*> NumericAnimationTrackMap;
    typedef std::map<uint16_t, NumericAnimationTrack*>::iterator NumericAnimationTrackMapIterator;
    typedef std::map<uint16_t, NumericAnimationTrack*>::const_iterator NumericAnimationTrackMapConstIterator;
}

#endif
